
/*import java.util.InputMismatchException;
import java.util.Scanner;


class login{
    private static String Username = "abc";
    private static String Password = "123456";

    public void LoginInfo(String username, String password)
            throws UserNameException,PassWordException{
        if(!this.Username.equals(Username)){
            throw new UserNameException("用户名错误");
        }
        if(!this.Password.equals(Password)){
            throw new PassWordException("密码错误");
        }
        System.out.println("登陆成功");
    }
}




public class test {

    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("123");
        String s = stringBuilder.toString();
    }

    public static void main9(String[] args) {
        try {
            login login = new login();
            login.LoginInfo("admin", "123");
        } catch (UserNameException e) {
            e.printStackTrace();
            System.out.println("捕捉到了用户名错误异常...");
        } catch (PassWordException e) {
            e.printStackTrace();
            System.out.println("捕捉到了密码错误异常...");
        }
        System.out.println("程序继续执行...");
    }
}*/


import java.util.InputMismatchException;
        import java.util.Scanner;

class Login {
    public String userName = "admin";
    public String passWord = "123456";


    public  void logIn(String userName, String passWord) {
        if(!this.userName.equals(userName)) {
            //System.out.println("用户名错误！");
            throw new UserNameException("用户名错误！");
        }

        if(!this.passWord.equals(passWord)) {
            //System.out.println("密码错误！");
            throw new PassWordException("密码错误！");
        }
    }

}
public class test {

    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("123");
        String s = stringBuilder.toString();
    }

    public static void main9(String[] args) {
        try {
            Login login = new Login();
            login.logIn("admin4", "1243");
        } catch (UserNameException e) {
            e.printStackTrace();
            System.out.println("捕捉到了用户名错误异常...");
        } catch (PassWordException e) {
            e.printStackTrace();
            System.out.println("捕捉到了密码错误异常...");
        }
        System.out.println("程序继续执行...");
    }
}







